# frozen_string_literal: true

{{#generated_src_warning}}
{{generated_src_warning}}
{{/generated_src_warning}}

module {{module_name}}
  # @api private
  module Endpoints

    {{#endpoint_classes}}
    class {{name}}
      def self.build(context)
        {{module_name}}::EndpointParameters.create(
          context.config,
          {{#parameters}}
          {{key}}: {{{value}}},
          {{/parameters}}
        )
      end
    end

    {{/endpoint_classes}}

    def self.parameters_for_operation(context)
      {{#operation_specific_parameters?}}
      {{module_name}}::EndpointParameters.create(context.config)
      {{/operation_specific_parameters?}}
      {{^operation_specific_parameters?}}
      case context.operation_name
      {{#endpoint_classes}}
      when :{{operation}}
        {{name}}.build(context)
      {{/endpoint_classes}}
      else
        {{module_name}}::EndpointParameters.create(context.config)
      end
      {{/operation_specific_parameters?}}
    end
  end
end
